home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2001 December / pcwk12201b.iso / Wersje pelne i specjalne / Winamp 2.77 i 3.0beta / wasabi-sdk_beta1.exe / studio / common / transcendentals.h < prev    next >
C/C++ Source or Header  |  2001-10-08  |  2KB  |  89 lines

  1. /*
  2.  
  3.   Nullsoft WASABI Source File License
  4.  
  5.   Copyright 1999-2001 Nullsoft, Inc.
  6.  
  7.     This software is provided 'as-is', without any express or implied
  8.     warranty.  In no event will the authors be held liable for any damages
  9.     arising from the use of this software.
  10.  
  11.     Permission is granted to anyone to use this software for any purpose,
  12.     including commercial applications, and to alter it and redistribute it
  13.     freely, subject to the following restrictions:
  14.  
  15.     1. The origin of this software must not be misrepresented; you must not
  16.        claim that you wrote the original software. If you use this software
  17.        in a product, an acknowledgment in the product documentation would be
  18.        appreciated but is not required.
  19.     2. Altered source versions must be plainly marked as such, and must not be
  20.        misrepresented as being the original software.
  21.     3. This notice may not be removed or altered from any source distribution.
  22.  
  23.  
  24.   Brennan Underwood
  25.   brennan@nullsoft.com
  26.  
  27. */
  28.  
  29. #ifndef       _TRANSCENDENTALS_H
  30. #define       _TRANSCENDENTALS_H
  31.  
  32. //
  33. //    This object provides static inlines to the CRT and 
  34. //    Fast Table Based Sin, Cos, etc... functions.  Add any
  35. //    needed functions at your leisure.
  36. typedef double Real;
  37. const Real kPI = 3.1415926535;
  38.  
  39. class Transcendental {
  40.  
  41.     //
  42.     // Enumerations    & Constants
  43.     protected:
  44.     public:    
  45.         // Ungrouped Constant Values
  46.         enum {
  47.             DEFAULT_TABLE_BITDEPTH = 8,
  48.             //
  49.             NUMBER_OF_CONSTANTS
  50.         } Constants;
  51.  
  52.     //
  53.     // Data
  54.     protected:
  55.         static int        currentTableBitdepth;
  56.  
  57.         static Real *    sinTable;
  58.     public:    
  59.  
  60.     //
  61.     // Constructors & Destructors
  62.     protected:
  63.     public:    
  64.         Transcendental();
  65.         ~Transcendental();
  66.  
  67.     //
  68.     // Published Static Methods
  69.     protected:
  70.         static void        makeTable( Real *&theTable );
  71.         static void        deleteTable( Real *&theTable );
  72.  
  73.     public:    
  74.         //    Changing Bitdepth
  75.         static void        initializeBitdepth( const int newBitdepth );
  76.         static void        setBitdepth( const int newBitdepth );
  77.         static int        getBitdepth( void );
  78.  
  79.         //    CRT Methods
  80.         static Real        mCRTSin( const Real radians );
  81.         static Real        mCRTCos( const Real radians );
  82. };
  83.  
  84.  
  85.  
  86.  
  87.  
  88. #endif    // _TRANSCENDENTALS_H
  89.